package com.yellow.car.impl;

import com.yellow.car.api.PathApi;
import com.yellow.car.api.StationApi;
import com.yellow.car.api.TruckApi;
import com.yellow.car.api.YellowCarApi;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
@Slf4j
public class RunApiImpl implements CommandLineRunner {
    @Resource
    PathApi pathApi;
    @Resource
    StationApi stationApi;
    @Resource
    YellowCarApi yellowCarApi;
    @Resource
    TruckApi truckApi;

    @Override
    public void run(String... args) throws Exception {
        //初始化小黄车
        yellowCarApi.init();
        //初始化货车
        truckApi.init();
        //初始化路径
        pathApi.setPath();
        //初始化站点
        stationApi.init();
    }
}
